<?php
/**
 * Get routes from an XML file.
 *
 */
class Router_Xml extends Router_File {
    /**
     * Read an XML file and build the route list.
     * @param string $filename
     * @param string $class
     * @param string $method
     */
    public function __construct($filename, $class = false, $method = false) {
        parent::__construct($filename, $class, $method);
        $routes = simplexml_load_file($filename);
        foreach($routes as $route) {
            $this->addRoute((string)$route->route, (string)$route->class, (string)$route->method);
        }
    }
}
?>